Skip to content

[material_ui] Cleans up shader files and exposes ink_splash shader - #12421

Merged
auto-submit[bot] merged 8 commits into
flutter:mainfrom
chunhtai:shader-clean
Aug 20, 2026
Merged

[material_ui] Cleans up shader files and exposes ink_splash shader#12421
auto-submit[bot] merged 8 commits into
flutter:mainfrom
chunhtai:shader-clean

Conversation

@chunhtai

Copy link
Copy Markdown
Contributor

the ink_splash is still using the flutter sdk's shader file, this pr fixes it

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: material_ui labels Aug 10, 2026
@Piinks Piinks added triage-design Should be looked at in design triage and removed triage-framework Should be looked at in framework triage labels Aug 17, 2026
@chunhtai
chunhtai marked this pull request as ready for review August 17, 2026 20:13
@chunhtai
chunhtai requested a review from justinmc August 17, 2026 20:13
@chunhtai chunhtai added the CICD Run CI/CD label Aug 17, 2026
@github-actions github-actions Bot added the triage-framework Should be looked at in framework triage label Aug 17, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the stretch_effect shader, exposes the ink_sparkle shader asset in pubspec.yaml, and updates its loading path in ink_sparkle.dart. Feedback indicates that the shader path in pubspec.yaml should be specified relative to the package root, starting with 'lib/' instead of 'packages/material_ui/'.

Comment thread packages/material_ui/pubspec.yaml Outdated

flutter:
shaders:
- packages/material_ui/shaders/ink_sparkle.frag

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

In pubspec.yaml, shader and asset paths must be specified relative to the package root. Since the shader file is located at lib/shaders/ink_sparkle.frag, the path should start with lib/ instead of packages/material_ui/.

    - lib/shaders/ink_sparkle.frag

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chunhtai is this right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah looks like it is right. will update

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to shaders/material_ink_sparkle.frag, added the material keyward to avoid id collision with flutter/flutter's old shader id

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turns out this is bad advice adding the package/material_ui and put the shader file in lib/shaders/ is the correct way according to this doc https://docs.flutter.dev/ui/assets/assets-and-images. reverting change back now

@justinmc justinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some questions.

Comment thread packages/material_ui/pubspec.yaml Outdated

flutter:
shaders:
- packages/material_ui/shaders/ink_sparkle.frag

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chunhtai is this right?

static void initializeShader() {
if (!_initCalled) {
ui.FragmentProgram.fromAsset('shaders/ink_sparkle.frag').then((ui.FragmentProgram program) {
ui.FragmentProgram.fromAsset('packages/material_ui/shaders/ink_sparkle.frag').then((

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't expect both of these paths to work... Are we sure it worked before and works after?

If somehow this wasn't working before this change, maybe it should be a patch change and be separate from the stretch_effect.frag removal.

@chunhtai chunhtai Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works before because flutter sdk manually inject a fragment shader during the flutter bundle assets command under the asset id shaders/ink_sparkle.frag

flutter sdk uses the old copy in the material file in flutter/flutter https://github.com/flutter/flutter/blob/f6c6f91d64d4e3d0fbc327a86fc7c513fd455161/packages/flutter_tools/lib/src/asset.dart#L823

This means the frag file in the current package/material_ui is not used at all before this change, and the ink_sparkle in this file is using the frag from flutter SDK

@chunhtai chunhtai Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a minor update because I introduced a new assets in this change.

removing strech_effect fragment has no effect at all because, like the ink_sparkling fragment, it is not used at all.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thank you for explaining!

@Piinks Piinks removed the triage-framework Should be looked at in framework triage label Aug 17, 2026
@github-actions github-actions Bot added the triage-framework Should be looked at in framework triage label Aug 18, 2026
@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 18, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 18, 2026
@auto-submit

auto-submit Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/packages/12421, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label.

@chunhtai
chunhtai requested a review from justinmc August 19, 2026 17:56
@github-actions github-actions Bot removed the triage-framework Should be looked at in framework triage label Aug 19, 2026

@justinmc justinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re LGTM 👍

Comment thread packages/material_ui/pubspec.yaml Outdated
- ui
- widgets
- material

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Remove this newline, or did you add it for some reason?

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 20, 2026
@auto-submit
auto-submit Bot merged commit 1785501 into flutter:main Aug 20, 2026
13 checks passed
pull Bot pushed a commit to Superoldman96/flutter that referenced this pull request Aug 20, 2026
…r#191420)

flutter/packages@fdd7d39...1785501

2026-08-20 47866232+chunhtai@users.noreply.github.com [material_ui]
Cleans up shader files and exposes ink_splash shader
(flutter/packages#12421)
2026-08-19 6655696+guidezpl@users.noreply.github.com [material_ui] Fixes
typo in code and tests (flutter/packages#12503)
2026-08-19 10687576+bparrishMines@users.noreply.github.com [pigeon]
Fixes lint error from unused codec (flutter/packages#12512)
2026-08-19 150371713+dhc-tech@users.noreply.github.com
[camera_android_camerax] Add explicit concurrent-futures dependency
(flutter/packages#12373)
2026-08-19 47866232+chunhtai@users.noreply.github.com [go_router]
migrates to material_ui and cupertino_ui (flutter/packages#12504)
2026-08-19 katelovett@google.com [animations] Migrate to material_ui
(flutter/packages#12467)
2026-08-19 21270878+elliette@users.noreply.github.com [material_ui] Add
Material tokens (version 38.2.50) (flutter/packages#12471)
2026-08-19 21270878+elliette@users.noreply.github.com Add
`triage-design` label (flutter/packages#12488)
2026-08-19 55915116+meliharik@users.noreply.github.com
[google_maps_flutter_platform_interface] Fix PinConfig code sample
(flutter/packages#12259)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants